﻿namespace Codeblack.TfsScrumboard.Interfaces
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Globalization;

    public interface IScrumboardSettings
    {
        SprintsSettings Sprints { get; set; }
        WorkitemsSettings Workitems { get; set; }
    }

    public class SprintsSettings
    {
        public string SprintType { get; set; }

        public string IterationPathFieldName { get; set; }
        public string StartDateFieldName { get; set; }
        public string FinishDateFieldName { get; set; }

        public string AllFieldNames
        {
            get
            {
                StringBuilder allFieldNames = new StringBuilder();
                allFieldNames.Append(this.IterationPathFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.StartDateFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.FinishDateFieldName);

                return allFieldNames.ToString();
            }
        }
    }

    public class WorkitemsSettings
    {
        public string TypeFieldName { get; set; }
        public string IDFieldName { get; set; }
        public string TitleFieldName { get; set; }
        public string StoryPointsFieldName { get; set; }
        public string IterationPathFieldName { get; set; }
        public string StatusFieldName { get; set; }
        public string AssignedToFieldName { get; set; }
        public string PriorityFieldName { get; set; }
        public string TeamProjectFieldName { get; set; }

        public string WorkItemTypes { get; set; }

        public string AllFieldNames
        {
            get
            {
                StringBuilder allFieldNames = new StringBuilder();
                allFieldNames.Append(this.TypeFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.IDFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.TitleFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.StoryPointsFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.IterationPathFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.StatusFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.AssignedToFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.PriorityFieldName);
                allFieldNames.Append(", ");
                allFieldNames.Append(this.TeamProjectFieldName);

                return allFieldNames.ToString();
            }
        }
    }
}
